/* GUI CONVERTED from eciq11.p (converter v1.76) Tue Dec 31 10:45:15 2002 */
/* eciq11.p - PCO TEXT INQUIRY                                          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.5.1.5 $                                                     */
/*V8:ConvertMode=Report                                                 */
/* REVISION: 7.4      LAST MODIFIED: 04/21/94   BY: qzl *H358*          */
/* REVISION: 7.4      LAST MODIFIED: 12/01/94   BY: qzl *H612*          */
/*                                   04/24/95   by: srk *H0C4*          */
/* REVISION: 7.4      LAST MODIFIED: 10/08/96   BY: *H0N2*  Russ Witt   */
/* REVISION: 8.6      LAST EDIT: 01/23/97       BY: John Worden *K04Z*  */
/* REVISION: 8.6      LAST EDIT: 05/20/98       BY: *K1Q4* Alfred Tan       */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00   BY: *N0KW* Jacolyn Neder    */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.5.1.5 $    BY: Katie Hilbert         DATE: 12/27/02  ECO: *P0L8*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

/*PLACED CONTENTS OF ECMTPARM.I IN HERE*/
define input parameter ecm_recid as recid.
define input parameter prog_type as character.
define input parameter inq_yn as logical.
define input parameter dmpld like mfc_logical.
define input parameter mstrfile like mfc_logical.
define output parameter msgnbr like msg_nbr initial 0.
define output parameter warnlvl as integer initial 0.

define variable ecd3ref like cmt_ref.
define variable ecmid like wo_lot.
define variable dbase like si_db.

define shared workfile ecmmstr like ecm_mstr.
define shared workfile ecd3det like ecd3_det.
define shared workfile cmtdet  like cmt_det.
define shared variable error_msg as character format "x(60)" extent 10.

do for ecmmstr,ecd3det,cmtdet:
   FORM /*GUI*/ 
      
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
{ecform03.i}
   with frame form03 attr-space side-labels width 80 overlay NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-form03-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame form03 = F-form03-title.
 RECT-FRAME-LABEL:HIDDEN in frame form03 = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame form03 =
  FRAME form03:HEIGHT-PIXELS - RECT-FRAME:Y in frame form03 - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME form03 = FRAME form03:WIDTH-CHARS - .5.  /*GUI*/


   /* SET EXTERNAL LABELS */
   setFrameLabels(frame form03:handle).

   find first ecmmstr where recid(ecmmstr) = ecm_recid no-lock no-error.
   if not available (ecmmstr) then return.

   pause 0.
   if ecm_cmtindx <> 0 then do:
      for each cmtdet no-lock where cmt_indx = ecm_cmtindx
         with frame form03:
         display
            substring(ecm_nbr,1,8)  @ ecm_nbr
            substring(ecm_nbr,9,8)  @ ecmid
            substring(ecm_nbr,17,8) @ dbase
            cmt_ref                 @ ecd3ref
            ""                      @ ecd3_order
            cmt_seq + 1             @ cmt_seq
            cmt_cmmt
         with frame form03 STREAM-IO /*GUI*/ .

         if not dmpld then do:
            if not mstrfile then put error_msg[6].
         end.

         down.
         
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/

      end.
   end.

   
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/


   for each ecd3det no-lock where ecd3_nbr = ecm_nbr
         by ecd3_order on endkey undo, return with frame form03:
      for each cmtdet no-lock where cmt_indx = ecd3_cmtindx
            on endkey undo, return  with frame form03:
         display
            substring(ecm_nbr,1,8)  @ ecm_nbr
            substring(ecm_nbr,9,8)  @ ecmid
            substring(ecm_nbr,17,8) @ dbase
            ecd3__qad03             @ ecd3ref
            ecd3_order
            cmt_seq + 1             @ cmt_seq
            cmt_cmmt WITH STREAM-IO /*GUI*/ .

         if not dmpld then do:
            if not mstrfile then put error_msg[6].

            else
            if can-find (ecd3_det where
                         ecd3_det.ecd3_nbr = ecd3det.ecd3_nbr and
                         ecd3_det.ecd3_cmtindx = ecd3det.ecd3_cmtindx)
            then put error_msg[1].
         end.

         down.
         
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/

      end.
      
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/

   end.
end.
